<?php

namespace app\models;
use \qore\base\Model;

/**
 * @author Samuel Nogueira <samuel.nogueira.dev@gmail.com>
 */
class Resource extends Model {
	const STATUS_NEW = 'STATUS_NEW';
	const STATUS_NOT_MODIFIED = 'STATUS_NOT_MODIFIED';
	const STATUS_DELETED = 'STATUS_DELETED';
	
	/**
	 * @var SplFileInfo
	 */
	public $fileInfo;
	
	/**
	 * @var string
	 */
	public $status;
	
	public function getId() {
		return md5($this->getFileInfo()->getRealPath());
	}
	
	public function isChanged() {
		return $this->getStatus() != static::STATUS_NOT_MODIFIED;
	}
}
